#include<stdio.h>
int main()
{
    FILE* fd=fopen("log.txt","w");
    int count=5;
    while(count)
    {
        fputs("hello world!\n",fd);
        count--;
     }

    count=5;
    char buffer[64];
    while(count)
    {
        fgets(buffer,sizeof(buffer),fd);
        printf("%s",buffer);
        count--;
    }
    fclose(fd);

    return 0;
}
